package xin.yangshuai.basic01.gof23.adapter.impl;

import xin.yangshuai.basic01.gof23.adapter.HdmiMonitor;
import xin.yangshuai.basic01.gof23.adapter.HdmiToHdmiCable;

public class MyHdmiToHdmiCable implements HdmiToHdmiCable {

    private HdmiMonitor hdmiMonitor;

    @Override
    public void connect(HdmiMonitor hdmiMonitor) {
        this.hdmiMonitor = hdmiMonitor;
    }

    @Override
    public String show() {
        System.out.println("通过当前设备：hdmi到hdmi数据线");
        if (hdmiMonitor != null) {
            return hdmiMonitor.show();
        }
        return null;
    }
}
